<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>uKernel: task.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">uKernel
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">task.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="task_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef __TASK_H__</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define __TASK_H__</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &quot;<a class="code" href="types_8h.html">types.h</a>&quot;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &quot;<a class="code" href="kern__conf_8h.html">kern_conf.h</a>&quot;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &quot;<a class="code" href="port_8h.html">port.h</a>&quot;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &quot;<a class="code" href="kernel_8h.html">kernel.h</a>&quot;</span>
<a name="l00008"></a>00008 
<a name="l00009"></a><a class="code" href="task_8h.html#aac747bed84189f8cfa509b94d488e622">00009</a> <span class="preprocessor">#define MAX_TASKS 10</span>
<a name="l00010"></a><a class="code" href="task_8h.html#aaa3f46abe4a3b45c2d13bbd92bdba022">00010</a> <span class="preprocessor"></span><span class="preprocessor">#define IDLE_PRIO MAX_TASKS - 1</span>
<a name="l00011"></a>00011 <span class="preprocessor"></span>
<a name="l00012"></a><a class="code" href="structtask__struct.html">00012</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structtask__struct.html">task_struct</a> {
<a name="l00013"></a><a class="code" href="structtask__struct.html#a1b06b905449173cd72df4be9e6f24cf5">00013</a>         <a class="code" href="types_8h.html#a701b7c820e8a0f5fcb04e4cd838b6f17">OSStackType</a> *<a class="code" href="structtask__struct.html#a1b06b905449173cd72df4be9e6f24cf5">TopOfStkPtr</a>;  <span class="comment">/* Top of task&#39;s stack*/</span>
<a name="l00014"></a><a class="code" href="structtask__struct.html#abc0389f3d197784023d06a4f4590290f">00014</a>         <a class="code" href="port__types_8h.html#a5f07f690b4e2ee699bcd09d3d301fa1f">uint_16</a> <a class="code" href="structtask__struct.html#abc0389f3d197784023d06a4f4590290f">prio</a>;           <span class="comment">/* Priority of corresponding task */</span>
<a name="l00015"></a><a class="code" href="structtask__struct.html#ae7dbf1cf0561b44973343e0cb9f7433b">00015</a>         <a class="code" href="types_8h.html#aa0aafed44fec19806d8f9ad834be1248">state_t</a> <a class="code" href="structtask__struct.html#ae7dbf1cf0561b44973343e0cb9f7433b">state</a>;          <span class="comment">/* State of task */</span>
<a name="l00016"></a>00016         <span class="comment">//uint_32 *StkPtr;      /* btm task&#39;s stack */</span>
<a name="l00017"></a>00017         
<a name="l00018"></a>00018 } <a class="code" href="task_8h.html#ab81cd44a453960b494ee7e9e3398da1f">TCB</a>;
<a name="l00019"></a>00019 
<a name="l00020"></a><a class="code" href="structtask__alt.html">00020</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structtask__alt.html">task_alt</a> {
<a name="l00021"></a><a class="code" href="structtask__alt.html#a24989b2330d3963de1a6969922e43de1">00021</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structtask__alt.html#a24989b2330d3963de1a6969922e43de1">r</a>[13];
<a name="l00022"></a><a class="code" href="structtask__alt.html#a95a968f629dcccf0030ae8e4c47e7c05">00022</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structtask__alt.html#a95a968f629dcccf0030ae8e4c47e7c05">SP</a>;
<a name="l00023"></a><a class="code" href="structtask__alt.html#aee7c0687a343825b05268a1dca554b9c">00023</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structtask__alt.html#aee7c0687a343825b05268a1dca554b9c">LR</a>;
<a name="l00024"></a><a class="code" href="structtask__alt.html#a49271787aa450bbaa176a0be9ec4b027">00024</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structtask__alt.html#a49271787aa450bbaa176a0be9ec4b027">xPSR</a>;
<a name="l00025"></a>00025 } <a class="code" href="task_8h.html#a6c80a6397c213c9da88c0803769d8866">TCBalt</a>;
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 <a class="code" href="types_8h.html#a5edd7aad54ac059bf561cf2f92017698">err_t</a> <a class="code" href="task_8c.html#acd272797cad46ce5cd917ad56576a0fd">task_create</a>(<a class="code" href="port__types_8h.html#ae126dcb96a70cdb6b5b72d7142229604">uint_8</a> prio, <a class="code" href="types_8h.html#a7ff77ba9f298c57ee621b35c801a25cd">task</a> <span class="keyword">function</span>, <span class="keywordtype">void</span> *args, <a class="code" href="types_8h.html#a701b7c820e8a0f5fcb04e4cd838b6f17">OSStackType</a> stack_size, <a class="code" href="types_8h.html#a701b7c820e8a0f5fcb04e4cd838b6f17">OSStackType</a> *tos);
<a name="l00029"></a>00029 <a class="code" href="types_8h.html#a5edd7aad54ac059bf561cf2f92017698">err_t</a> <a class="code" href="task_8c.html#af8c9e7a8bc1a2912f921f5737c7dd581">TaskEnable</a>(<a class="code" href="port__types_8h.html#a5f07f690b4e2ee699bcd09d3d301fa1f">uint_16</a> prio);
<a name="l00030"></a>00030 <a class="code" href="structtask__struct.html">TCB</a> * <a class="code" href="task_8c.html#a639bfc7e2db2ee2317f80312b9aefcd6">TCBAlloc</a>(<span class="keywordtype">void</span>);
<a name="l00031"></a>00031 <span class="keywordtype">void</span> <a class="code" href="task_8c.html#a4f1a45cad16b50afcc59d289fbd97cba">TCBInit</a>(<a class="code" href="structtask__struct.html">TCB</a> *newTCB, <a class="code" href="port__types_8h.html#ae126dcb96a70cdb6b5b72d7142229604">uint_8</a> prio, <a class="code" href="port__types_8h.html#a64e458b61bddf0b87a3701578aa7a428">uint_32</a> stk_size);
<a name="l00032"></a>00032 <span class="keywordtype">void</span> <a class="code" href="task_8c.html#a7fb3c86222f374882e78d8286d89a223">TaskArrayInit</a>(<span class="keywordtype">void</span>);
<a name="l00033"></a>00033 <span class="keywordtype">void</span> <a class="code" href="task_8c.html#aca90fabb2cd21c7593c5e1c0bdbfdb04">ReadyArrayInit</a>(<span class="keywordtype">void</span>);
<a name="l00034"></a>00034 <a class="code" href="structtask__struct.html">TCB</a> *<a class="code" href="task_8c.html#ab7c0831fcbeea57a0b307fe8e7f982d4">getTCBbyPrio</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> prio);
<a name="l00035"></a>00035 <span class="preprocessor">#if HIGHEST_PRIO_ALT != 3</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="keywordtype">void</span> <a class="code" href="port_8h.html#a5c295a85cd2f272dde9c67914ecf7799">FindHighestPriorityTask</a>(<span class="keywordtype">void</span>);
<a name="l00037"></a>00037 <span class="preprocessor">#endif</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span>
<a name="l00039"></a>00039 <span class="keywordtype">void</span> <a class="code" href="task_8c.html#ac48128e72b303ea22d8ec641a9516b15">schedule</a>(<span class="keywordtype">void</span>);
<a name="l00040"></a>00040 <span class="keywordtype">void</span> <a class="code" href="task_8c.html#a58c8b2ad0ea491a6642e5e1cbd358c89">yield</a>(<span class="keywordtype">void</span>);
<a name="l00041"></a>00041 
<a name="l00042"></a>00042 
<a name="l00043"></a>00043 <span class="keyword">extern</span> <a class="code" href="structtask__struct.html">TCB</a> *<a class="code" href="task_8c.html#a87e44ad7c879f9920bd5acb1e0d5a4b0">currentTCB</a>;
<a name="l00044"></a>00044 <span class="keyword">extern</span> <a class="code" href="structtask__struct.html">TCB</a> *<a class="code" href="task_8c.html#a5f29d3a38ef44f195d05d851a7656890">highestTCB</a>;
<a name="l00045"></a>00045 <span class="keyword">extern</span> <a class="code" href="structtask__struct.html">TCB</a> *<a class="code" href="task_8h.html#a30982a446e06775cd6f618072e44fe44">currentTCBalt</a>;
<a name="l00046"></a>00046 <span class="keyword">extern</span> <a class="code" href="structtask__struct.html">TCB</a> *<a class="code" href="task_8h.html#a59fb871d53934c7268d09ce10ab7fafa">highestTCBalt</a>;
<a name="l00047"></a>00047 <span class="keyword">extern</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="task_8h.html#a8ef63a13bc1d8e05669b75b76117740a">OSTicks</a>;
<a name="l00048"></a>00048 <span class="preprocessor">#endif</span>
</pre></div></div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Sun Oct 13 2013 02:33:11 for uKernel by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.0
</small></address>

</body>
</html>
